import traceback


def extract_text_from_txt(file_path):
    try:
        with open(file_path, 'r', encoding="utf-8", errors="ignore") as file:
            return file.read()
    except Exception as e:
        # print(traceback.format_exc())
        print(f"错误: 发生未知错误 - {e}")
        traceback.print_exc()

    return None
